<?php

namespace App\Model;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

/**
 * App\Model\ArticleCategories
 *
 * @property-read \Illuminate\Database\Eloquent\Collection|\App\Model\Articles[] $article
 * @method static bool|null forceDelete()
 * @method static \Illuminate\Database\Query\Builder|\App\Model\ArticleCategories onlyTrashed()
 * @method static bool|null restore()
 * @method static \Illuminate\Database\Query\Builder|\App\Model\ArticleCategories withTrashed()
 * @method static \Illuminate\Database\Query\Builder|\App\Model\ArticleCategories withoutTrashed()
 * @mixin \Eloquent
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\ArticleCategories newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\ArticleCategories newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\ArticleCategories query()
 * @property int $id 主键
 * @property string $title 标题
 * @property int $sort 排序
 * @property int $parent_id 父级分类
 * @property \Illuminate\Support\Carbon $created_at 创建日期
 * @property \Illuminate\Support\Carbon $updated_at 修改时间
 * @property string|null $deleted_at 删除时间
 * @property int|null $is_enabled 是否1表示下架，0显示
 * @property int $is_modify 用户自定义分类对应是否允许修改0否1是
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\ArticleCategories whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\ArticleCategories whereDeletedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\ArticleCategories whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\ArticleCategories whereIsEnabled($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\ArticleCategories whereIsModify($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\ArticleCategories whereParentId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\ArticleCategories whereSort($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\ArticleCategories whereTitle($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\ArticleCategories whereUpdatedAt($value)
 */
class ArticleCategories extends Model
{

    use SoftDeletes;
    protected $table = 'article_categories';

    protected $primaryKey = 'id';

    protected $casts = [
        'article_category_id' => 'int',
        'id' => 'int'
    ];
    protected $dates = ['delete_at'];


    protected $fillable = ['id','title', 'sort'];

    protected $guarded= ['delete_at'];
    public function article()
    {
        return $this->hasMany(Articles::class, 'article_category_id', 'id');
    }
}
